<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.extremecomponents.org" prefix="ec"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SFERH - Registro de Parientes</title>
<jsp:include page="../includeCSSjs.jsp" />

<!-- Extream Component -->
<link rel="stylesheet" type="text/css"
	href="../resources/css/extremecomponents.css">
<script type="text/javascript"
	src="../resources/javascript/extremecomponents.js"></script>
	
<script type="text/javascript"
	src="../resources/javascript/jquery.js"></script>

<script type="text/javascript">
	function onTableClick(	idEmpleado	) {

		$("#idEmpleado").val(idEmpleado);				
		showEditBtn();
	}

	function showEditBtn() {
		$(".btnEditar").hide("fast");
		$(".btnAgregar").hide("slow");
		$(".btnEditar").show("slow");

	}

	function hiddenEditBtn() {
		$(".btnEditar").hide("fast");
		$(".btnAgregar").show("slow");
	}
</script>

</head>
<body>
	<h2 class="divTextoEncabezado">Catalogo de Empleados</h2>

	<form:form method="post" action="showParent"
		commandName="emp">
		
		<form:errors path="*" cssClass="errorblock" element="div" />

		<form:hidden path="idEmpleado"/>
		<center>
				<div class='btnAgregar'>
					<input type=image src="../resources/img/boton_agregar.png"
						width="95" height="30" class="inputBoton">
				</div>
				
				<div class="btnEditar" style="display: none;">
					<input type=image src="../resources/img/boton_guardar.png"
						width="95" height="30" class="inputBoton"
						onclick="edit('titulo','editTitulo')"> 
					<input type=image src="../resources/img/btn_eliminar.png" width="95"
						height="30" class="inputBoton"
						onclick="edit('titulo','deleteTitulo')"> 
					<input type=image src="../resources/img/boton_agregar.png" width="95" 
						height="30"	class="inputBoton" 
						onclick="edit('emp','showParent')">
				</div>
			</center>
	</form:form>
	
	<!-- Extreme Table  -->
	<ec:table items="empList"
		action="${pageContext.request.contextPath}/admin/showEmp"
		view="compact"
		imagePath="${pageContext.request.contextPath}/resources/images/compact/*.gif"
		rowsDisplayed="8" autoIncludeParameters="false" var="emp">
		
		

		<ec:row highlightRow="true" 
		onclick="onTableClick(	'${pageScope.emp.idEmpleado}' );">
			<ec:column property="idEmpleado" title="Id" />
			<ec:column property="nr" title="N.R." />
			<ec:column property="nombreCompleto" title="Nombre del Empleado"/>			
		</ec:row>
	</ec:table>
</body>
</html>